<template>
	<view class="content">
		<view class="item_div">
			<image class="left_img" src="../../static/icon_head.png"></image>
			<text class="title_text">头像</text>
			<image class="header_img" src="../../static/center_head_bg.png"></image>
			<image class="right_img" src="../../static/sobot_right_arrow_icon.png"></image>
		</view>


		<view class="item_div">
			<image class="left_img" src="../../static/icon_userinfo.png" style="width: 34rpx;"></image>
			<text class="title_text">姓名</text>
			<text class="value_text">{{userInfo.name}}</text>
		</view>

		<view class="item_div">
			<image class="left_img" src="../../static/icon_gender.png" style="width: 34rpx;"></image>
			<text class="title_text">性别</text>
			<text class="value_text">{{userInfo.sex}}</text>
		</view>

		<view class="item_div">
			<image class="left_img" src="../../static/new_icon_tk_ztjl.png" style="width: 34rpx;"></image>
			<text class="title_text">所属院校班级</text>
			<text class="value_text">{{userInfo.schoolName}} {{userInfo.classId.name}}</text>
		</view>

		<view class="item_div">
			<image class="left_img" src="../../static/icon_birthday.png" style="width: 34rpx;"></image>
			<text class="title_text">入学年份</text>
			<text class="value_text">{{userInfo.startDate}}年</text>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: ''
			}
		},
		onLoad() {
			this.getUserInfo();
		},
		methods: {
			getUserInfo: function() {
				var uid = uni.getStorageSync('uid');
				var that = this;
				uni.request({
					url: this.baseUrl + 'student/getStudent',
					method: 'GET',
					data: {
						'stuId': uid
					},
					header: {
						'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
					},
					success: (res) => {
						console.log(res);
						that.userInfo = res.data.data;
					}
				})
			}
		}
	}
</script>

<style>
	.content {
		background: #FFFFFF;
	}

	.item_div {
		height: 88rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding-left: 20rpx;
		padding-right: 20rpx;
		border-bottom: 1px solid #E8E8E8;
	}

	.item_div .left_img {
		width: 30rpx;
		height: 30rpx;
	}

	.item_div .title_text {
		flex: 1;
		font-size: 26rpx;
		color: #333333;
		margin-left: 10rpx;
	}

	.item_div .header_img {
		height: 56rpx;
		width: 56rpx;
	}

	.item_div .right_img {
		width: 13rpx;
		height: 26rpx;
		margin-left: 10rpx;
	}

	.item_div .value_text {
		font-size: 24rpx;
		color: #666666;
	}
</style>
